<template>
	<view>
		<!-- 头部个人信息 -->
		<view class="nav">
			<view class="nav-box">
				<view class="nav-box2">
					<image class="head-img" :src="img" mode=""></image>
					<view class="message">
						<view>用户名：{{name}}</view>
						<view>地址：{{address}}</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 操作 -->
		<view class="my-list" @click="updata()">
			<view class="list-box">
				<image style="width: 40upx;height: 40upx;" src="../../static/imgs/wodeshezhi.png" mode=""></image>
				<view>删除账号</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			show: false,
			stu: '1',
			name:'楚河',
			img:'../../static/img/touxiang.png',
			address:''
		};
	},
	onLoad() {
		this.name = uni.getStorageSync('name')
		this.img = uni.getStorageSync('headImg')
		this.address = uni.getStorageSync('address')
	},
	onShow() {
		
	},
	methods: {
		updata(){//修改账号
			uni.navigateTo({
				url:"/pages/login/updata"
			})
		},
		
		quit(){//退出
			uni.showModal({//弹框，是否确认选择
			    content: '是否确认退出登录!',
			    showCancel: true,//只有确定没有取消
			    success: function (res) {
			        if (res.confirm) {
			            console.log('用户点击确定');
						uni.showToast({
							title: '退出成功',
							icon:'none',
						});
						uni.clearStorageSync()
						setTimeout(function(){
							uni.reLaunch({
								url: '/pages/login/login'
							})
						},800)
			        } else if (res.cancel) {
			            console.log('用户点击取消');
			        }
			    }
			});
		}
	}
};
</script>

<style>
page {
	background: #f8f8f8;
}
.nav {
	background: #ffffff;
	padding: 20upx;
	border-top: 1px solid #ffffff;
	margin-bottom: 20upx;
	color: #ffffff;
}
.nav-box {
	display: flex;
	justify-content: space-between;
}
.nav-box2 {
	display: flex;
	align-items: center;
	margin-bottom: 20upx;
}
.head-img {
	width: 120upx;
	height: 120upx;
	margin-right: 30upx;
	border-radius: 50%;
}
.message {
	color: #333333;
}

/* 下面的信息查询 */
.my-list {
	background: #ffffff;
	display: flex;
	justify-content: space-between;
	padding: 30upx;
	margin-bottom: 25upx;
}
.list-box {
	display: flex;
}
.list-box image {
	margin-top: 10upx;
}
.list-box view {
	font-size: 32upx;
	margin-left: 30upx;
}
</style>
